package com.deep.order.feign;

import com.deep.common.model.dto.SkuHasStockTO;
import com.deep.common.utils.R;
import com.deep.order.model.dto.WareSkuLockDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 库存系统远程调用接口
 *
 * @author Deep
 * @date 2022/2/15
 */
@FeignClient("mall-ware")
public interface WareFeignService {
    /**
     * 查询sku是否有库存
     */
    @PostMapping("/ware/waresku/hasstock")
    List<SkuHasStockTO> getSkusHasStock(@RequestBody List<Long> skuIds);

    /**
     * 锁定库存
     */
    @PostMapping(value = "/ware/waresku/lock/order")
    R orderLockStock(@RequestBody WareSkuLockDTO lockDTO);
}
